<% layout('/layouts/default.html', {title: '图片管理管理', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text(shPic.isNewRecord ? '新增图片管理' : '编辑图片管理')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${shPic}" action="${ctx}/sys/shPic/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> 图片名字：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:input path="name" maxlength="40" class="form-control required"/>
							</div>
						</div>
					</div>
				<#form:hidden path="picAddr"/>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> 跳转地址：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:input path="link" maxlength="150" class="form-control required url" placeholder="请输入http://或https://开始地址"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 显示顺序：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="displayOrder" maxlength="11" class="form-control required digits" placeholder="默认以此值倒序"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 跳转方式：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="jumpType" dictType="pic_jump_method" class="form-control required" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2"><span class="required ">*</span>图片上传：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage" bizKey="${shPic.id}" bizType="shPic_image"
									uploadType="image" class="required" readonly="false"
								returnPath="true" filePathInputId="picAddr"
								maxUploadNum="1" imageMaxWidth="1920"  imageMaxHeight="430" isMini="true"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('sys:shPic:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>